home *** CD-ROM | disk | FTP | other *** search
- Path: news.th-darmstadt.de!news
- From: Enno Sandner <enno@intellektik.informatik.th-darmstadt.de>
- Newsgroups: comp.lang.c++
- Subject: Re: Question on null pointers
- Date: Fri, 05 Jan 1996 15:04:45 +0100
- Organization: Fachbereich Informatik, TH Darmstadt
- Message-ID: <30ED2FFD.794BDF32@intellektik.informatik.th-darmstadt.de>
- References: <4chov6$ms@tamarack.cs.mtu.edu>
- NNTP-Posting-Host: kitz.intellektik.informatik.th-darmstadt.de
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0b4 (X11; I; SunOS 4.1.3 sun4m)
-
- Saurabh Jang wrote:
- >
- > ANSI C clearly allows constructs of the form
- >
- > if ( p ) or if ( !p ) where p is a pointer variable. Is this legal in ANSI C++?
- > Or is the preferred style if ( p != 0 ) or if ( p != NULL ) ?
- >
- > Reading the ARM I felt that this topic was left ambiguous. Or did I miss
- > something?
- >
-
- Remember that C++ is intended to be an extension of C (with some minor
- exceptions). So constructs that are valid in C and not explicitly
- forbidden in C++ should remain valid in C++.
- The occurences of 'p' and '!p' do both form valid C++-expressions if
- 'p' is a pointer.
-
- Enno
-